<!DOCTYPE HTML>
<html>
<head>
	<?php
		include("include.php");
		$ID = mysql_escape_string($_GET['id']);
		$events = eventHelper::getUpcomingEventsWithTag($ID, 8);
		$tagName = tag::getTagNameByID($ID);
	?>
</head>
<body>

<div class="container">
	<div id="header">
		<?php include("banner.php")?>
		
		<div id="login">
			<?php login::displayLoginDiv(); ?>
		</div>
		
		<div class="clear"></div>
		
		<div id="navigation">
			<?php include('navigation.php'); ?>
		</div>
	</div>
	
	<div class="clear"></div>
	
	<div id="body">
		<div id="content">
			<h1>Upcoming Events for <?php echo $tagName; ?></h1>
			
			<?php 
			if(empty($events))
			{
				echo 'No events with this tag.';
			}
			else 
			{ ?>
				<?php
				foreach($events as $ID => $event)
				{ ?>
					<div class="event">
						<div class="image">
							<img src="<?php echo $event['IMAGE_PATH']; ?>" />
						</div>
						<div class="text">
							<h2><a href="event.php?eventID=<?php echo $ID;?>"><?php echo $event['NAME']; ?></a></h2>
							<p>Location: <?php echo $event['LOCATION']; ?></p>
							<p>When: <?php echo ourDate::formatDate($event['START_TIME']); ?></p>
							<p>Description: <?php echo substr($event['DESCRIPTION'], 0, 100)." . . ."; ?></p>
						</div>
					</div>
					
					<div class="clear"></div>
				<?php
				}
			} ?>
			
		</div>
		<div id="tags">
			<h1>Tags</h1>
			<?php tag::displayTagCloud(); ?>
		</div>
		
		<div id="fblike">
			<?php include "facebookLike.php"; ?>
        </div>
	
	</div>
	
	<div class="clear"></div>
	
	<div id="footer">
		<?php include("footer.php"); ?>
	</div>

</div>


</body>
</html>